package Reminder.domain;

import com.alibaba.fastjson.JSONObject;

public class Course {
    private String name;
    private String teacher;
    private String classroom;
    private String description;
    private String color;

    public Course(String name, String teacher, String classroom, String description,String color) {
        this.name = name;
        this.teacher = teacher;
        this.classroom = classroom;
        this.description = description;
        this.color = color;
    }
    public static Course parseJSON(JSONObject course){
        return new Course(
            course.getString("name"),
            course.getString("teacher"),
            course.getString("classroom"),
            course.getString("description"),
            course.getString("color")
        );
    }

    public JSONObject toJSON(){
        JSONObject jsonObject = new JSONObject();
        jsonObject.put("name",this.name);
        jsonObject.put("teacher",this.teacher);
        jsonObject.put("classroom",this.classroom);
        jsonObject.put("description",this.description);
        jsonObject.put("color",this.color);
        return  jsonObject;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getTeacher() {
        return teacher;
    }

    public void setTeacher(String teacher) {
        this.teacher = teacher;
    }

    public String getClassroom() {
        return classroom;
    }

    public void setClassroom(String classroom) {
        this.classroom = classroom;
    }

    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    public String getColor() {
        return color;
    }
    public void setColor(String color) {
        this.color = color;
    }
}
